const mixinDate = {
  props: ['column', 'scope'],
  data() {
    const {
      disabled,
      label
    } = this.column
    return {
      disabled: !!disabled,
      placeholder: disabled ? '' : `请输入${label}`,
      value: this.scope.row[this.column.prop]
    }
  },
  watch: {
    scope({ row }) {
      this.value = row[this.column.prop]
    }
  },
  methods: {
    handleChange(v) {
      this.$emit('on-edit', v, this.column.prop, this.scope.$index)
    }
  }
}

export default mixinDate
